#!/bin/bash

echo '更新项目'
git pull

echo "安装依赖包"
npm install

echo "准备就绪，是否重启？（r=重启/s=启动）？"
read isRestart
if test $isRestart = 'r';then
# chat服务
pm2 restart bin/www
# socket服务
pm2 restart bin/socket.js
else
pm2 start bin/www
pm2 start bin/socket.js
fi